import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { PersonalComponent } from './personal.component';
import { ProfileComponent } from './components/profile/profile.component';
import { UserValidatorGuard } from './guards';

const routes: Routes = [
  {
    path: '',
    component: PersonalComponent,
    canActivate: [ UserValidatorGuard ],
    children: [
      {
        path: '',
        redirectTo: 'profile',
        pathMatch: 'full'
      },
      {
        path: 'profile',
        component: ProfileComponent,
        data: {
          name: '个人信息'
        }
      }
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class PersonalRoutingModule { }
